package com.regex.web.entity.sys;

import java.io.Serializable;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.regex.web.common.excel.annotation.ExcelField;
import com.regex.web.entity.StrIdAllBaseEntity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
 * <p>
 * 组织机构
 * </p>
 *
 * @author mhy
 * @since 2020-08-03
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("sys_dept")
public class DeptDTO extends StrIdAllBaseEntity implements Cloneable {

    private static final long serialVersionUID = 1L;

    /**
     * 组织名称
     */
    @TableField("name")
    @ExcelField(title="组织名称",  align=2 , sort=1, dictType="")
    private String name;

    /**
     * 组织编码
     */
    @TableField("code")
    @ExcelField(title="组织编码",  align=2 , sort=2, dictType="")
    private String code;

    /**
     * 上级组织
     */
    @TableField("parent_id")
    @ExcelField(title="上级组织",  align=2 , sort=3, dictType="")
    private String parentId;

    /**
     * 组织类型
     */
    @TableField("type")
    @ExcelField(title="组织类型",  align=2 , sort=4, dictType="")
    private String type;

    /**
     * 商家编码
     */
    @TableField("bus_id")
    @ExcelField(title="商家编码",  align=2 , sort=5, dictType="")
    private String busId;
    
    @TableField(exist = false)
    private String parentName;

    @Override
    protected Serializable pkVal() {
        return super.pkVal();
    }


	private static DeptDTO deptDTO = new DeptDTO();
    
    public static DeptDTO getInstance() {
        try {
            return (DeptDTO) deptDTO.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return new DeptDTO();
    }

}
